package main

import "fmt"

func main() {
	c := make(chan int) // 定义一个channel

	go func() {
		defer println("goroutine end ...")
		fmt.Println("goroutine run ...")
		c <- 666 // 将666发送给c
	}()

	num := <-c //从c中接受数据，并赋值给num

	fmt.Println("num = ", num)
	fmt.Println("main goroutine end ...")

}
